Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve references before validating the discriminator #1815

Merged
merged 15 commits into from
Jan 15, 2022

Conversation

dfeufel
Copy link
Contributor

@dfeufel dfeufel commented Nov 12, 2021

fixes #1554

What issue does this pull request resolve?

What changes did you make?

Is there anything that requires more attention while reviewing?

@epoberezkin
Copy link
Member

Great - added some comments, it’s quite a common request.

please also update the docs to mention that single $refs (that is, without siblings) are now supported as well.

@epoberezkin
Copy link
Member

CI runs a bit more combinations of options than run locally by default, it uses:

AJV_FULL_TEST=true npm test

Maybe that’s the difference?

See the test output in CI.

@epoberezkin
Copy link
Member

So you can try locally with the same env variable

lib/vocabularies/discriminator/index.ts Outdated Show resolved Hide resolved
lib/vocabularies/discriminator/index.ts Outdated Show resolved Hide resolved
@epoberezkin
Copy link
Member

Thanks for the change, it definitely improves the usability of discriminator - only supporting inlined schema was an annoying restriction...

There couple of comments I wanted to amend - let me know if it's ok I do it?

@dfeufel
Copy link
Contributor Author

dfeufel commented Nov 22, 2021

Sure, feel free.

docs/json-schema.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Discriminator logic will not dereference schemas before validating preconditions
2 participants